import os
import matplotlib.pyplot as plt


# 查看图像数量
def read_flower_data(folder_name):
    folders = os.listdir(folder_name)
    flower_names = []
    flower_nums = []
    for folder in folders:
        folder_path = os.path.join(folder_name, folder)
        images = os.listdir(folder_path)
        images_num = len(images)
        print("{}:{}".format(folder, images_num))
        flower_names.append(folder)
        flower_nums.append(images_num)
    return flower_names, flower_nums


if __name__ == "__main__":
    path = "img/flower_photos"
    x, y = read_flower_data(path)
